import { FC, useState } from "react";
import QuestionCard from "../../components/QuestionCard";
import { Empty } from "antd";

const list = [
  {
    _id: "q1",
    title: "问卷1",
    isPublished: true,
    isStar: true,
    answerCount: 3,
    createdAt: "3月11日 13:23",
  },
  {
    _id: "q4",
    title: "问卷3",
    isPublished: true,
    isStar: true,
    answerCount: 3,
    createdAt: "3月11日 13:23",
  },
  {
    _id: "q5",
    title: "问卷4",
    isPublished: false,
    isStar: true,
    answerCount: 3,
    createdAt: "3月11日 13:23",
  },
];

const Star: FC = () => {
  const [questionList] = useState(list);

  return (
    <div>
      <div className="flex justify-between mb-5">
        <div className="text-xl font-bold">星标问卷</div>
        <div>搜索</div>
      </div>
      <div>
        {questionList.length == 0 && <Empty />}
        {questionList.map(question => {
          const { _id } = question;
          return <QuestionCard key={_id} {...question}></QuestionCard>;
        })}
      </div>
      <div>footer</div>
    </div>
  );
};

export default Star;
